package com.example.springbootdemo;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Description:
 * User: 故我
 * Date: 2023-10-29
 * Time: 20:53
 */
//1、必须要有config... 注解前提告诉要获取哪个对象
//2、类名必须要和配置文件中的类对象名一致 + set + get 方法
@ConfigurationProperties("student")
@Component
@Data
public class Student {
    private int id;
    private String name;
    private int age;
}
